package com.minminaya.source;

public class Algorithm_11 {


    public static void reOrderOddEven(int[] arr) {
        if (arr == null || arr.length < 2) {
            return;
        }

        int start = 0;
        int end = arr.length - 1;

        while (start < end) {
            //找偶数，
            while (start < end && arr[start] % 2 != 0) {
                start++;
            }

            while (start < end && arr[end] % 2 == 0) {
                end--;
            }

            int temp = arr[start];
            arr[start] = arr[end];
            arr[end] = temp;

        }
    }

}
